package main

import "fmt"

// 定义接口
type Person interface{
	getName() string
	//getAge() int 

}

//定义Student结构体实现person接口
type Student struct{
	name string
	age int 
}

func (stu *Student) getName() string{
	return stu.name
}

func (stu *Student) getAge() int{
	return stu.age
}


func main() {
	fmt.Println("vim-go")
	var p Person = &Student{
		name: "Tom",
		age: 18,
	}

	fmt.Println(p.getName())
	//fmt.Println(p.getAge())

	//接口转换为结构体实例
	stu := p.(*Student)
	fmt.Println(stu.getAge())

	var arr1 [5]interface{}
	arr1[0] = "abc"
	arr1[1] = 3.14
	arr1[2] = [3]int{1,2,3}
	fmt.Println(arr1)
}
